<!-- <script setup lang="ts">
import { getHomeGoodsGuessLikeAPI } from '@/services/home'
import type { PageParams } from '@/types/global'
import type { GuessItem } from '@/types/home'
import { onMounted, ref } from 'vue'

// 分页参数
const pageParams: Required<PageParams> = {
  page: 1,
  pageSize: 10,
}
// 猜你喜欢的列表
const guessList = ref<GuessItem[]>([])
// 已结束标记
const finish = ref(false)
// 获取猜你喜欢数据
const getHomeGoodsGuessLikeData = async () => {
  // 退出分页判断
  if (finish.value === true) {
    return uni.showToast({ icon: 'none', title: '没有更多数据~' })
  }
  const res = await getHomeGoodsGuessLikeAPI(pageParams)
  // guessList.value = res.result.items
  // 数组追加
  guessList.value.push(...res.result.items)
  // 分页条件
  if (pageParams.page < res.result.pages) {
    // 页码累加
    pageParams.page++
  } else {
    finish.value = true
  }
}
// 重置数据
const resetData = () => {
  pageParams.page = 1
  guessList.value = []
  finish.value = false
}
// 组件挂载完毕
onMounted(() => {
  getHomeGoodsGuessLikeData()
})
// 暴露方法
defineExpose({
  resetData,
  getMore: getHomeGoodsGuessLikeData,
})
</script> -->
<template>

  <view class="guess" style="padding-top: 20rpx;">
    <navigator
      class="guess-item"
      v-for="(item,index) in guessList"
      :key="item.id"
      @click="guess(index)"
    >
    <view class="" style="width: 304rpx;height: 304rpx;display: flex;    flex-direction: column; justify-content: center;
    align-items: center;">
       <image class="image" mode="aspectFill" :src="item.picture" style="width: 45px;height: 45px;"></image>
       <text style="padding-top: 10px;">{{item.dec}}</text>
    </view>

    </navigator>
  </view>

</template>
<script>

	export default {

		data() {
			return {
        guessList:[
          // {picture:'../../../static/images/auto.png',dec:'我的订单'},
          // {picture:'../../../static/images/shi.png',dec:'我的订单'},


          {picture:'../../../static/images/order.png',dec:'我的订单'},
          {picture:'../../../static/images/hai.png',dec:'我的垃圾桶'},
          {picture:'../../../static/images/gan.png',dec:'退出登录'},
           {picture:'../../../static/images/kf.jpg',dec:'客服'},
        ]
			}
		},
		onShow() {

		},
		methods: {
      guess(index){
        console.log(index,'121212');
        if(index == 0){
          uni.navigateTo({
            url:'/pagesOrder/list/list'
          })
        }else if(index == 2){
         uni.removeStorageSync("userinfo")
         uni.removeStorageSync("wxuser")
         uni.navigateTo({
           url:'/pages/index/index'
         })
        }else if(index == 1){
          console.log(111111);
          uni.navigateTo({
            url:'/pagesOrder/lajilist/list'
          })
        }else if(index == 3){
          console.log(111111);
          uni.navigateTo({
            url:'/pagesOrder/kf/index'
          })
        }
      }
		}
	}
</script>
<style lang="scss">
:host {
  display: block;
}
/* 分类标题 */
.caption {
  display: flex;
  justify-content: center;
  line-height: 1;
  padding: 36rpx 0 40rpx;
  font-size: 32rpx;
  color: #262626;
  .text {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 28rpx 0 30rpx;

    &::before,
    &::after {
      content: '';
      width: 20rpx;
      height: 20rpx;
      background-image: url(@/static/images/bubble.png);
      background-size: contain;
      margin: 0 10rpx;
    }
  }
}

/* 猜你喜欢 */
.guess {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0 20rpx;
  .guess-item {
    width: 345rpx;
    padding: 24rpx 20rpx 20rpx;
    margin-bottom: 20rpx;
    border-radius: 10rpx;
    overflow: hidden;
    background-color: #fff;
  }
  .image {
    width: 50%;
    height: 50%;
  }
  .name {
    height: 75rpx;
    margin: 10rpx 0;
    font-size: 26rpx;
    color: #262626;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .price {
    line-height: 1;
    padding-top: 4rpx;
    color: #cf4444;
    font-size: 26rpx;
  }
  .small {
    font-size: 80%;
  }
}
// 加载提示文字
.loading-text {
  text-align: center;
  font-size: 28rpx;
  color: #666;
  padding: 20rpx 0;
}
</style>
